home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / upplow / upplowhl.frm < prev   
Text File  |  1995-03-01  |  3KB  |  79 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    BackColor       =   &H00808080&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Function - ForceUpperOrLowerCase"
  6.    ClientHeight    =   4020
  7.    ClientLeft      =   3195
  8.    ClientTop       =   2610
  9.    ClientWidth     =   6015
  10.    ControlBox      =   0   'False
  11.    Height          =   4455
  12.    Left            =   3120
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    MousePointer    =   3  'I-Beam
  17.    ScaleHeight     =   4020
  18.    ScaleWidth      =   6015
  19.    Top             =   2250
  20.    Width           =   6165
  21.    Begin TextBox Text1 
  22.       Alignment       =   2  'Center
  23.       BackColor       =   &H00808080&
  24.       BorderStyle     =   0  'None
  25.       ForeColor       =   &H0000FFFF&
  26.       Height          =   3615
  27.       Left            =   120
  28.       MultiLine       =   -1  'True
  29.       TabIndex        =   0
  30.       Text            =   "Text1"
  31.       Top             =   120
  32.       Width           =   5415
  33.    End
  34. End
  35. ' SetUpLoH.Bas - Help Screen
  36. ' 95/03/02 Copyright 1995, Larry Rebich, The Bridge, Inc.
  37.  
  38.     Option Explicit
  39.     DefInt A-Z
  40.  
  41.     Declare Sub SendMessage Lib "User" (ByVal hWnd%, ByVal wMsg%, ByVal wParam%, lParam As Any)
  42.  
  43. Sub BuildHelpMessage ()
  44.     Dim Msg As String
  45.     Dim Cr As String * 2
  46.     Cr = Chr$(13) & Chr$(10)
  47.     Msg = Cr
  48.     Msg = Msg & "Any text entered in the upper case text box is converted to all upper case.  "
  49.     Msg = Msg & "Any text entered in the lower case text box is converted to all lower case." & Cr
  50.     Msg = Msg & Cr
  51.     Msg = Msg & "Function ForceUpperOrLowerCase is used to force "
  52.     Msg = Msg & "upper or lower "
  53.     Msg = Msg & "case input.  For example: " & Cr & Cr
  54.     Msg = Msg & "x = ForceUpperOrLowerCase(Text1(1), True)"
  55.     Msg = Msg & Cr & Cr
  56.     Msg = Msg & "See module UppLow.Bas for details." & Cr & Cr
  57.     Msg = Msg & "Note: This text box has been set to 'read only' using API SendMessage.  See subroutine 'SetReadOnly' in this form for details." & Cr
  58.     Text1 = Msg
  59. End Sub
  60.  
  61. Sub Form_Load ()
  62.     Dim l, t, w, h
  63.     w = Text1.Width + 500       'make form fit the text box
  64.     h = Text1.Height + 500
  65.     l = (Screen.Width - w) \ 2
  66.     t = Form1.Top + Form1.Height + 100  'just below the main form
  67.     Move l, t, w, h
  68.     Text1.Move 150, 150         'set its location
  69.     SetReadOnly Text1           'set text box to read only
  70.     BuildHelpMessage            'build the message
  71. End Sub
  72.  
  73. Sub SetReadOnly (TheControl As Control)
  74.     Const WM_USER = &H400
  75.     Const EM_SETREADONLY = (WM_USER + 31)
  76.     SendMessage TheControl.hWnd, EM_SETREADONLY, 1, 0
  77. End Sub
  78.  
  79.